tinyMCE.init({
	language: "ru",
	mode : "exact",
	elements : "item_description",
	theme : "advanced",
	skin : "o2k7",
    skin_variant : "silver",
	plugins : "style,table,save,advhr,images,advlink,advimage,preview,media,searchreplace,,contextmenu,paste,fullscreen,visualchars,nonbreaking, inlinepopups , ajaxfilemanager",

	// Theme options
	theme_advanced_buttons1 : "newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
	theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,images,image,separator,ezfilemanager,cleanup,code,|preview,|,forecolor,backcolor,|,styleprops",
	theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,visualchars,nonbreaking,|,charmap,media,advhr,|,fullscreen",
	theme_advanced_toolbar_location : "top",
	theme_advanced_toolbar_align : "left",
	theme_advanced_path_location : "bottom",
	theme_advanced_resize_horizontal : false,
	theme_advanced_resizing : true,
	document_base_url : "/",
	content_css : "/css/editor.css",
	file_browser_callback : "ajaxfilemanager",
	relative_urls : false

});
function ajaxfilemanager(field_name, url, type, win)
{
	var ajaxfilemanagerurl = "/js/tiny_mce/plugins/ajaxfilemanager/ajaxfilemanager.php";
	switch (type) {
		case "image": break;
		case "media": break;
		case "flash": break;
		case "file":  break;
		default: return false;
	}
    tinyMCE.activeEditor.windowManager.open({
        url: ajaxfilemanagerurl,
        width: 800, height: 470, inline : "yes", close_previous : "no"
    },{ window : win, input : field_name });
}